const req = (that,funName,params)=>{
  that.loading = true
  if(!params)
  {
    let params = {}
  }
	return new Promise((resolve)=>{
		uniCloud.callFunction({
			name:funName,
			data:params,
			success:res=>{
        that.loading = false
				resolve(res)
			},
			fail:()=>{
				uni.$showMsg('数据加载失败')
			}
		})
	})
}

module.exports = {
	req
}